package b1.conifg
{
	public class ObjectConfig
	{
		//类别：0, 骨头; 1, 药剂; 2, 防具; 3,弓箭
		public var type:int;
		//价格（骨头)
		public var priceBones:int;
		//价格（金骨头)
		public var priceGoldBones:int;
		//所有物品的唯一索引
		public var index:int;
		//物品名字
		public var name:String;
		//描述文字
		public var description:String;
		//骨头在战斗场景中的高度
		public var boneHeight:int;
		//需要等级 
		public var requireLevel:int;
		//需要智力
		public var requireInteligenceLevel:int;
		//抛出消耗体力值
		public var vitalityCost:int;
		//攻击值，消耗对手生命值
		public var attackPoint:int;
		//碰撞范围
		public var hitArea:int;
		//额外的功能数据1
		public var bonusData1:Number;
		//热点
		public var hitPoints:Array;
		//额外的功能数据2
		public var bonusData2:Number;
		//额外的功能数据3
		public var bonusData3:Number;
		//效果（代号）
		public var effects:Object;
		//物品图片
		public var iconImage:String;
		//是否在商店中售出
		public var onSaleFlag:Boolean;
		//分裂的骨头个数
		public var splitBoneNum:int;
		//分裂的基本骨头的索引
		public var splitBoneIndex:int;
		//密度
		public var density:Number;
		//弹性
		public var restitution:Number;
		//重量
		public var weight:Number;
		//是否在战斗中显示
		public var noShowInFightFlag:Boolean;
		
		public function ObjectConfig(objectXML:XML)
		{
			attackPoint = parseInt(objectXML.attackPoint);
			bonusData1 = parseFloat(objectXML.bonusData1);
			bonusData2 = parseFloat(objectXML.bonusData2);
			bonusData3 = parseInt(objectXML.bonusData3);
			description = objectXML.description;
			hitArea = parseInt(objectXML.hitArea);
			index = parseInt(objectXML.index);
			hitPoints = new Array();
			for (var i:int = 0; i < objectXML.hitPoint.length(); i++)
			{
				var hitPoint:HotPoint = new HotPoint(objectXML.hitPoint[i]);
				hitPoints.push(hitPoint);
			}
			name = objectXML.name;
			boneHeight = parseInt(objectXML.boneHeight);
			priceBones = parseInt(objectXML.priceBones);
			priceGoldBones = parseInt(objectXML.priceGoldBones);
			requireLevel = parseInt(objectXML.requireLevel);
			requireInteligenceLevel = parseInt(objectXML.requireInteligenceLevel);
			type = parseInt(objectXML.type);
			vitalityCost = parseInt(objectXML.vitalityCost);
			weight = parseFloat(objectXML.weight);
			restitution = parseFloat(objectXML.restitution);
			density = parseFloat(objectXML.density);
			iconImage = objectXML.iconImage;
			noShowInFightFlag = Boolean(parseInt(objectXML.noShowInFightFlag));
			onSaleFlag = Boolean(parseInt(objectXML.onSaleFlag));
			splitBoneNum = parseInt(objectXML.splitBoneNum);
			splitBoneIndex = parseInt(objectXML.splitBoneIndex);
			effects = new Object();
			for (i = 0; i < objectXML.effect.length(); i++)
			{
				var effectIndex:int = parseInt(objectXML.effect[i]);
				effects[effectIndex] = effectIndex; 
			}
		}

	}
}